/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.brand.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.brand.entity.Brand;
import com.jeeplus.modules.brand.mapper.BrandMapper;

/**
 * 品牌Service
 * @author zhych
 * @version 2021-12-08
 */
@Service
@Transactional(readOnly = true)
public class BrandService extends TreeService<BrandMapper, Brand> {

	public Brand get(String id) {
		return super.get(id);
	}

	public List<Brand> findList(Brand brand) {
		if (StringUtils.isNotBlank(brand.getParentIds())){
			brand.setParentIds(","+brand.getParentIds()+",");
		}
		return super.findList(brand);
	}

	@Transactional(readOnly = false)
	public void save(Brand brand) {
		super.save(brand);
	}

	@Transactional(readOnly = false)
	public void delete(Brand brand) {
		super.delete(brand);
	}

}